#pragma once

/////////////////////////////////////////////////////////////////////////////
// CCircleProgCtrl window

class CCircleProgCtrl : public CProgressCtrl
{
	DECLARE_DYNAMIC(CCircleProgCtrl)

public:
	CCircleProgCtrl(bool red2green, bool usepos1);

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCircleProgCtrl)
protected:
	void PreSubclassWindow() override;
	//}}AFX_VIRTUAL

// Implementation
public:
	~CCircleProgCtrl() override;
	void SizeToContent();
	void FitSize(bool fitWidth);
	void SetTitle(LPCWSTR t);
	void SetText(LPCWSTR t);
	intptr_t  SetPos(intptr_t nPos);
	intptr_t  SetPos(intptr_t nPos, intptr_t nPos1);
	intptr_t	 SetPosText(intptr_t nPos);
	void SetRange(intptr_t nLower, intptr_t nUpper);

protected:
	//{{AFX_MSG(CCircleProgCtrl)
	afx_msg void OnPaint();
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()

private:
	CBitmap *m_bmpBackground,*m_bmpDisable;
	CBitmap *m_drawBackground,*m_drawDisable;
	wchar_t m_Title[40];
	wchar_t m_Text[40];
	intptr_t m_titleLine, m_textLine;
	intptr_t m_px, m_py, m_ptLen;
	intptr_t m_nCurPos, m_nCurPos1, m_nLower, m_nUpper;
	void ChangeRgn();
	bool m_r2g, m_usePos1;

	void DrawPoint(CPaintDC *pDC, intptr_t pos, COLORREF clr, intptr_t width);
public:
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
};
